#include <stdio.h>
int main(){
	int a[30]={1,1,2};
	int i,n;
	for(i=2;i<30;i++){
			a[i]=a[i-1]+a[i-2];
		}
	while(scanf("%d",&n)!=EOF){
		if(n<=0){
			break;
		}
		printf("%d\n",a[n-1]);
		
	}

} 
